package com.itheima.homework01.setdemo03;

import java.util.LinkedHashSet;
import java.util.Set;

public class SetTest3 {
    public static void main(String[] args) {
        Set<Integer> set = new LinkedHashSet<>();
        set.add(20);
        set.add(30);
        set.add(50);
        set.add(10);
        set.add(30);
        set.add(20);
        //Set集合存入元素不重复
        set.forEach(num -> System.out.println(num));
        System.out.println("--------------------------------");
        //使用增强for遍历集合，打印大于25的元素
        for (Integer number : set) {
            if (number > 25) {
                System.out.println(number);
            }
        }
    }
}
